package Web;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author wuhan
 * @date 2019/10/16 14:52
 */
public class Demo1 {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress i = InetAddress.getLocalHost();
        System.out.println(i.toString());
        System.out.println("Address"+i.getHostAddress());
        System.out.println("Name"+i.getHostName());
        InetAddress byName = InetAddress.getByName("www.baidu.com");
        System.out.println(byName.toString());
    }
}
